#include <header.h>

int main(){

    int fd1 =  open("1.txt", O_RDWR);
    int fd2 = open("2.txt", O_RDWR|O_CREAT, 0666);


    struct stat st;
    fstat(fd1, &st);
    void *p1 = mmap(NULL, st.st_size,  PROT_READ|PROT_WRITE,  MAP_SHARED,  fd1,  0);


    write(fd2, p1, st.st_size);

    munmap(p1, st.st_size);

    close(fd1);
    close(fd2);
    return 0;
}

